{include file="index/header" /}
<body>
	<div class="panel admin-panel">
		<form method="get" action="" id="listform">
			<div class="panel-head"><strong class="icon-reorder"> {$user.know_remarks ?: $user.know_nickname}-{$user.know_phone ?: $user.know_email}</strong> </div>
			<div class="padding border-bottom">
				<ul class="search" style="padding-left:10px;">
					<li>搜索：</li>
					<li>
						<input type="search" placeholder="关键词" name="kw" value="{$param.kw}" class="input" style="width:250px; line-height:17px;display:inline-block;"/>
					</li>
					<a href="javascript:void(0)" class="button border-main" onclick="changesearch()">搜索</a>
				</ul>
			</div>
			<table class="table table-hover text-center">
				<tr>
					<th>ID</th>
					<th>专业</th>
					<th>阶段</th>
					<th>章节</th>
					<th>课程</th>
					<th>新回答</th>
					<th>时间</th>
					<th>是否已回答</th>
					{if $admin['role_id'] neq 8}<th>是否推荐</th>{/if}
					<th>操作</th>
				</tr>
				{foreach $data as $v}
				<tr>
					<td>{$v.id}</td>
					<td>{$v.nav_name}</td>
					<td>{$v.type_name}</td>
					<td>{$v.s_name}</td>
					<td>{$v.course_name}</td>
					<td>{if $v.zhuiwen}{$v.zhuiwen}|({$v.count}个){/if}</td>
					<td>{$v.time|date='Y-m-d H:i:s',###}</td>
					<td style="cursor: pointer;">{if $v.answer eq 1}是{else}否{/if}</td>
					{if $admin['role_id'] neq 8}<td onclick="changetuijian(this,{$v.id})" style="cursor: pointer;" title="点击修改状态"><font color="#00CC99">{if $v.is_tuijian eq 1}是{else}否{/if}</font></td>{/if}
					<td><div class="button-group"><a class="button border-main" onclick="javascript:openwinx('{:url('answer',['id' => $v['id'],'class_id'=>$param['class_id']])}')"><span class="icon-edit"></span>点评</a></div></td>
				</tr>
				{/foreach}
				<tr>
					<td colspan="9">{$page}</td>
				</tr>
			</table>
		</form>
	</div>
	<script>
		//搜索
		function changesearch(){  
			$("#listform").submit();
		}
		function changetuijian(ts,id){
			$.ajax({
				data:{'id':id},
				url:"{:url('tuijian')}",
				type:'post',
				success:function(data){
					if(data == 2){
						alert('修改失败');
					}else{
						if(data == 1){
							var tuijian = '<font color="#00CC99">是</font>';
						}else{
							var tuijian = '<font color="#00CC99">否</font>';
						}
						$(ts).html(tuijian);
					}
				}
			});
		}
		function openwinx(url,name,w,h) {
			if(!w) w=screen.width-4;
			if(!h) h=screen.height-95;
			window.open(url,name,"top=30,left=400,width=" + w + ",height=" + h + ",toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no");
		}
	</script>
</body></html>
